package com.pk.platform.util.filter;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.apache.struts2.ServletActionContext;
import org.aspectj.lang.JoinPoint;

public class ExceptionInterceptor  {

    private Logger log = Logger.getLogger(ExceptionInterceptor.class);
  
    public void exceptionIntercept(JoinPoint point, Throwable ex) {
    	System.out.println("----产生的异常已记录到日志中----");
        HttpServletRequest req = ServletActionContext.getRequest();
        log.error(ex.getMessage(), ex);
        String error = ex.getMessage();
        req.setAttribute("errorMsg", error);
    }
 

}
